package com.disapand.dingdang.controller

import com.disapand.dingdang.vo.ResponseVO
import com.disapand.dingdang.dto.LoginDTO
import org.hibernate.validator.constraints.Length
import org.springframework.validation.annotation.Validated
import org.springframework.web.bind.annotation.*
import javax.validation.Valid
import javax.validation.constraints.Email
import javax.validation.constraints.Min
import javax.validation.constraints.NotEmpty

/**
 * @author disapand
 * @date 2022/2/23 - 17:31 星期三
 */

@RestController
@RequestMapping("/user", name = "用户相关资源")
@Validated
class UserController {

    @PostMapping("/login", name = "登录")
    fun login(
        @RequestBody login: LoginDTO
    ): ResponseVO {
        return ResponseVO.ofSuccess()
    }

    @PostMapping("/account")
    fun addUser(
        @NotEmpty(message = "name 不能为空")
        @Email(message = "请输入正确的邮箱格式")
        @RequestParam name: String
    ) {

    }
}